home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
layoutc.exe
/
REPORT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-27
|
4KB
|
72 lines
#include <stdio.h>
main()
{
char time[]="10:00 pm";
char date[]="05/03/91";
char name[]="Lincoln Beach Software";
char address[]="P.O. Box 1554";
char city[]="Ballwin";
char state[]="MO";
char zip[]="63022";
int value=175;
// The code below was generated using LAYOUT.EXE,
// And imported into this file.
// The data above was manually created.
// This will not compile because of the unknown variable
// On line 57 which is bad_variable. An error was generated
// When the report was processed with LAYOUT. Also line 56
// Will have an unknown in it because there is a place holder
// And no value to be placed in it.
// If you fix these two errors it will compile and you can see
// The output for yourself.
fprintf(stdprn,"Use To Generate Report Layouts:\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"%-8s You Can Line Up Titles Easier Date: %-8s\n\r",time,date);
fprintf(stdprn," And Set Up Output Without Guessing\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"Name Address City State Zip Code\n\r");
fprintf(stdprn,"====================== ==================== ============== ===== ===========\n\r");
fprintf(stdprn,"%-22s %-19s %-14s %-2s %-10s\n\r",name,address,city,state,zip);
fprintf(stdprn,"\n\r");
fprintf(stdprn,"******************************************************************************************************\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"Or address labels: %-21s\n\r",name);
fprintf(stdprn," %-19s\n\r",address);
fprintf(stdprn," %-2s, %-2s %-2s\n\r",city,state,zip);
fprintf(stdprn,"\n\r");
fprintf(stdprn,"******************************************************************************************************\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"And Numbers:\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"This is a %6X Hex number.\n\r",value);
fprintf(stdprn,"This is a %6d Decimal number.\n\r",value);
fprintf(stdprn,"This is a %6.2f Float Number.\n\r",value/5.5);
fprintf(stdprn,"\n\r");
fprintf(stdprn,"******************************************************************************************************\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"You Can Use The Percent Sign In Other Ways:\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"This is a %%/dollar example to show it can be used with something.\n\r");
fprintf(stdprn,"And it can also be used by itself %% .\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"******************************************************************************************************\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"You Can Also Prefill %-2s Fields\n\r","Desired");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"******************************************************************************************************\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"You Can Also Use Characters [%c] & %c.\n\r",'a','b');
fprintf(stdprn,"\n\r");
fprintf(stdprn,"******************************************************************************************************\n\r");
fprintf(stdprn,"It Also Performs A Data Integrity Check:\n\r");
fprintf(stdprn,"\n\r");
fprintf(stdprn,"This %-3s will generate a warning because of no variable.\n\r");
fprintf(stdprn,"And this will generate an error because of no place holder. \n\r",bad_variable);
fprintf(stdprn,"\n\r");
}